import {GET,POST} from "./config"
import axios from "axios";



const instance = axios.create({
  baseURL:"http://192.168.92.20:9998/",//发送请求时，会在url前拼接baseUrl

  


  timeout:8000
})

	//封装GET POST
export function request(method,url,params){
  switch (method){
    case GET:
      return get(url,params)
    case POST:
      return post(url,params)
  }
}

function get(url,params){


  return instance({
    url: url,
    method: 'get',
    params: params
  })
}

function post(url,params){
  return instance.post(url,params)
}
